﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using MySql.Data.MySqlClient;

/// <summary>
/// Summary description for InterdisciplinaryBLL
/// </summary>
public class InterdisciplinaryBLL
{
    string connection = WebConfigurationManager.ConnectionStrings["UCNLinkDB"].ConnectionString;

    public int CreateInterdiscipinaryLink(int _pId, int _divId)
    {
        int result = 0;
        MySqlConnection conn = new MySqlConnection(connection);
        MySqlCommand cmd = new MySqlCommand("INSERT INTO tblInterdisciplinary(projectID, divisionID) VALUES (@projectID, @divisionID)", conn);

        cmd.Parameters.Add("@projectID", MySqlDbType.Int32);
        cmd.Parameters["@projectID"].Value = _pId;

        cmd.Parameters.Add("@divisionID", MySqlDbType.Int32);
        cmd.Parameters["@divisionID"].Value = _divId;

        conn.Open();

        result = cmd.ExecuteNonQuery();
        cmd.Dispose();
        conn.Close();

        return result;
    }

	public InterdisciplinaryBLL()
	{
		
	}
}